package com.leozhang.app;

import com.spire.xls.*;

// 生成多 Sheet Excel
public class MultiSheetExcel {
    public static void main(String[] args) {
        Workbook workbook = new Workbook();

        // 添加工作表
        Worksheet sheet1 = workbook.getWorksheets().add("Sheet1");
        Worksheet sheet2 = workbook.getWorksheets().add("Sheet2");

        sheet1.getCellRange("A1").setText("Sheet 1 Content");
        sheet2.getCellRange("A1").setText("Sheet 2 Content");

        workbook.saveToFile("MultiSheet.xlsx", ExcelVersion.Version2016);
    }
}

